package {
	import org.flixel.FlxObject;
	import org.flixel.FlxSprite;
	
	public class Collider extends FlxSprite{
		
		public var parent:NiloGroup;
		public var uniqueID:String;
		
		public function Collider(X:Number, Y:Number, Width:Number, Height:Number){
			super(X, Y);
			width = Width;
			height = Height;
			makeGraphic(width, height, 0x55990000);
			//	TODO: set this value to false before shipping:
			visible = false;
			uniqueID = "none";
		}
		
		public function setID(uniqueID:String):Collider {
			this.uniqueID = uniqueID;
			return this;
		}
		
		public function makeSolid():Collider {
			this.solid = true;
			this.immovable = true;
			return this;
		}
		
		public function collidedWith(object:FlxObject):void{
			if (object is Collider){
				parent.collidedWithCollider(this, object as Collider);
			}
			else {
				parent.collided(this, object);
			}
		}
		
		public function outOfBounds():void{
			parent.colliderOutOfBounds(this);
		}
	}
}
